powers of diagonal matrices